package com.superman.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CurrentPayment {
    public static double getCurrentPayment(String start_date, double rent){
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        format.setLenient(false);
        long days = 0;
        try {
            Date date = format.parse(start_date);
            days=(System.currentTimeMillis() - date.getTime())/(1000*60*60*24) + 1;//此处计算费用的时候需要进一
        } catch (ParseException e) {
            e.printStackTrace();
        }finally {
            return rent*days;
        }
    }
}
